package cz.tomasdvorak.cars.wicket.components.table;

import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.OddEvenItem;
import org.apache.wicket.markup.repeater.data.IDataProvider;
import org.apache.wicket.model.IModel;

public class SimpleDataTable<T> extends DataTable<T> {
    public SimpleDataTable(String id, IColumn<T>[] columns, IDataProvider<T> dataProvider) {
        super(id, columns, dataProvider, Integer.MAX_VALUE);
        addTopToolbar(new HeadersToolbar(this, null));
    }

    protected Item<T> newRowItem(String id, int index, IModel<T> model) {
        return new OddEvenItem<T>(id, index, model);
    }
}
